/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

// TODO
/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "student")
public class Student {
  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "STUDENT_ID", unique = true, nullable = false)
  private long studentId;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Ad> ads;

  @ManyToMany(fetch = FetchType.LAZY, mappedBy = "students")
  private Set<Course> courses;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<YearGroup> yearGroups;// groups that have been created by student

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.student", cascade = CascadeType.ALL)
  private Set<StudentGroup> studentGroups = new HashSet<StudentGroup>(0);

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<MainPagePost> mainPagePosts;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Comment> comments;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Location> locations;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Opinion> opinions;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Question> questions;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Answer> answers;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<CalendarEntry> calendarEntries;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Post> posts;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "student")
  private Set<Reply> replies;

  private String name;
  private String surname;
  private boolean isStudent;
  private boolean isGraduate;
  private String email;
  private String gender;
  private Date dateOfBirth;
  private String cityOfOrigin;

  public Student() {
  }

  public long getStudentId() {
    return studentId;
  }

  public void setStudentId(long studentId) {
    this.studentId = studentId;
  }

  public Set<Course> getCourses() {
    return courses;
  }

  public void setCourses(Set<Course> courses) {
    this.courses = courses;
  }

  public Set<Ad> getAds() {
    return ads;
  }

  public void setAds(Set<Ad> ads) {
    this.ads = ads;
  }

  public Set<Location> getLocations() {
    return locations;
  }

  public void setLocations(Set<Location> locations) {
    this.locations = locations;
  }

  public Set<Opinion> getOpinions() {
    return opinions;
  }

  public void setOpinions(Set<Opinion> opinions) {
    this.opinions = opinions;
  }

  public Set<Question> getQuestions() {
    return questions;
  }

  public void setQuestions(Set<Question> questions) {
    this.questions = questions;
  }

  public Set<Answer> getAnswers() {
    return answers;
  }

  public void setAnswers(Set<Answer> answers) {
    this.answers = answers;
  }

  public Set<MainPagePost> getMainPagePosts() {
    return mainPagePosts;
  }

  public void setMainPagePosts(Set<MainPagePost> mainPagePosts) {
    this.mainPagePosts = mainPagePosts;
  }

  public Set<Comment> getComments() {
    return comments;
  }

  public void setComments(Set<Comment> comments) {
    this.comments = comments;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSurname() {
    return surname;
  }

  public void setSurname(String surname) {
    this.surname = surname;
  }

  public boolean isStudent() {
    return isStudent;
  }

  public void setStudent(boolean isStudent) {
    this.isStudent = isStudent;
  }

  public boolean isGraduate() {
    return isGraduate;
  }

  public void setGraduate(boolean isGraduate) {
    this.isGraduate = isGraduate;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getGender() {
    return gender;
  }

  public void setGender(String gender) {
    this.gender = gender;
  }

  public Date getDateOfBirth() {
    return dateOfBirth;
  }

  public void setDateOfBirth(Date dateOfBirth) {
    this.dateOfBirth = dateOfBirth;
  }

  public String getCityOfOrigin() {
    return cityOfOrigin;
  }

  public void setCityOfOrigin(String cityOfOrigin) {
    this.cityOfOrigin = cityOfOrigin;
  }

  public Set<StudentGroup> getStudentGroups() {
    return studentGroups;
  }

  public void setStudentGroups(Set<StudentGroup> studentGroups) {
    this.studentGroups = studentGroups;
  }

  public Set<CalendarEntry> getCalendarEntries() {
    return calendarEntries;
  }

  public void setCalendarEntries(Set<CalendarEntry> calendarEntries) {
    this.calendarEntries = calendarEntries;
  }

  public Set<Post> getPosts() {
    return posts;
  }

  public void setPosts(Set<Post> posts) {
    this.posts = posts;
  }

  public Set<Reply> getReplies() {
    return replies;
  }

  public void setReplies(Set<Reply> replies) {
    this.replies = replies;
  }

  public Set<YearGroup> getYearGroups() {
    return yearGroups;
  }

  public void setYearGroups(Set<YearGroup> yearGroups) {
    this.yearGroups = yearGroups;
  }

}
